<template>
	<view class="beijingse mainpadding">
		<view class="shangbj mainpadding ffffff radius" v-for="item in list" :key="item.id" @click="tzxq(item.id)">
			<view class="flextop">
				<image class="toxuia " :src="item.avatar_text" mode=""></image>
				<view class="" style="width: 80%;">
					<view class="flexbetween">
						<view class="">
							<view class="flexleft">
								<view class="sanshier fonweight xiaohei margin_right1">{{item.nickname}}</view>
								<view class="biaoq flexcenter">{{item.cj_text}}</view>
							</view>
							<view class="ershiba xiaohui margin_top1">{{item.mobile}}</view>
						</view>
						<view class="" v-if="item.childlist.length" @click.stop="item.isshow=!item.isshow">
							<u-icon name="arrow-down" color="#333333" size="20" v-if="item.isshow" ></u-icon>
							<u-icon name="arrow-up" color="#333333" size="20" v-if="!item.isshow"></u-icon>
						</view>
					</view>
					<view v-show="item.isshow">
						<view class="flexleft margin_top" v-for="ite in item.childlist" :key="ite.id"  @click.stop="tzxq(ite.id)">
							<image class="toxuia margin_right2" :src="ite.avatar_text" mode=""></image>
							<view class="">
								<view class="flexleft">
									<view class="sanshier fonweight xiaohei margin_right1">{{ite.nickname}}</view>
									<view class="biaoq flexcenter">{{ite.cj_text}}</view>
								</view>
								<view class="ershiba xiaohui margin_top1">{{ite.mobile}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init() {
				httpRequest.request('/api/user/teamList', 'GET', {
				}).then(res => {
					res.data.forEach(item=>{
						this.$set(item,"isshow",false)
					})
					this.list = res.data
				}).catch(err => {
				})
			},
			// 跳转详情
			tzxq(id) {
				uni.navigateTo({
					url: '/pages_mypage/tuanduixq?id='+id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	.biaoq {
		width: 65rpx;
		height: 32rpx;
		font-size: 20rpx;
		font-family: Source Han Sans CN, Source Han Sans CN;
		font-weight: 400;
		color: #2361FF;
		border: 1rpx solid #2361FF;
		border-radius: 20rpx;
	}

	.toxuia {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
	}

	.shangbj {
		margin-top: 30rpx;
	}

	.shangbj:first-child {
		margin-top: 0rpx;
	}
</style>